project(1.18-thrust)

enable_language(CUDA)#激活CUDA语言支持，使用第一个写法时要进行注释
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --extended-lambda")  # 禁用异常机制
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")  #禁用运行时类型信息
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")  # 禁用异常机制

set(BASE_PATH /media/chyang/data/third_party/linux)
set(CUDA_HOME ${BASE_PATH}/cuda/cuda_12.3)
set(TRT_HOME ${BASE_PATH}/tensorrt/TensorRT-8.6.1.6/)

# Find CUDA.
include_directories(${CUDA_HOME}/include)
link_directories(${CUDA_HOME}/lib)

# Find TensorRT
include_directories(${TRT_HOME}/include/)
link_directories(${TRT_HOME}/lib)

add_executable(1.18-thrust src/main.cu)
target_link_libraries(1.18-thrust PUBLIC cuda cudart nvinfer nvinfer_plugin nvonnxparser)